package com.dragon.mmochat.message;

import com.dragon.mmochat.MmochatConstant;
import com.dragon.mmochat.model.battle.MmochatAction;
import com.dragon.mmochat.model.enumType.MmochatActionType;
import com.skymobi.buffer.SkymobiBuffer;
import com.skymobi.message.SkymobiProtocolMessage;

public class Mmochat_3_2C extends SkymobiProtocolMessage {
	MmochatAction action = new MmochatAction();

	public Mmochat_3_2C() {
		setMsgCode(MmochatConstant.MSGCODE_MMOCHAT_C_3_2);
	}

	@Override
	protected void decodeBody(SkymobiBuffer in) {
		action.setBattleId(in.getInt());
		action.setTurn(in.getUnsigned());
		action.setPos(in.get());
		action.setActionType(MmochatActionType.get((int) in.getUnsigned()));
		action.setTargetPos(in.get());
		action.setGridId(in.getInt());
	}

	public MmochatAction getAction() {
		return action;
	}

}